package com.xianxing.search.pojo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@Document(indexName = "articleinfo",type = "doc",shards = 5,replicas = 0)
public class ArticleInfo {

    

    //文章id，同时也是文章编号
    @Id
    @Field(index = true, store = true, type = FieldType.Long)
    private Long articleId;

    //文章名
    @Field(index = true, store = true, type = FieldType.Text, analyzer = "ik_smart", fielddata = true)
    private String articleName;

    //文章内容
    @Field(index = true,store = true,type = FieldType.Text,analyzer = "ik_smart")
    private String articleContent;

    //文章创建时间
    private Date articleTime;

    //文章浏览人数
    private Integer articleClick;

    //作者
    @Field(store = true,type = FieldType.Keyword)
    private String userName;

    //分类id
    @Field(index = true, store = true, type = FieldType.Long)
    private Integer typeId;


}
